package io.github.wslxm.springbootplus2.core.base.desensitization.handler;


import cn.hutool.core.util.DesensitizedUtil;
import io.github.wslxm.springbootplus2.core.base.desensitization.DesensitizationHandler;
import org.apache.commons.lang3.StringUtils;

/**
 * 【数字隐藏】 隐藏字符串中的所有数字
 *
 * @author wangsong
 * @date 2023/09/05
 */
public class HideNumberDesensitizationHandler implements DesensitizationHandler {

    @Override
    public String handler(String str) {
        if(StringUtils.isBlank(str)){
            return str;
        }
        return str.replaceAll("\\d", "*");
    }
}
